<template>
	<el-dialog title="预览" v-model="previewDialogVisible" width="70%">
		<div style="background-color: #fafafa;">
			<div class="van-doc-simulator">
				<PageComponent  ref="pageComponent"></PageComponent>
			</div>
		</div>
		
	</el-dialog>
</template>

<script>
	import PageComponent from '@/mcomponents/PageComponent.vue';
	export default {
		name: "previewDialog",
		components: {
			PageComponent
		},
		data() {
			return {
				previewDialogVisible: false,
			}
		},
		provide() {
			return {
				children: []
			}
		},
		methods: {
			setVisible(visible) {
				this.previewDialogVisible = visible;
				if (visible) {
					this.$nextTick(function() {
						this.loadPage();
					});
				}
			},
			loadPage() {
				var pageCode = this.$store.state.mformDesigner.getCreateContext().pageCode;
				this.$refs.pageComponent.navigatePage(pageCode, {},false);
			}
		},
	}
</script>

<style>
</style>
